#include <stdio.h>

/**
 * Note: The returned array must be malloced, assume caller calls free().
 */
int *twoSum(int *numbers, int numbersSize, int target, int *returnSize)
{
    int *result = (int *)malloc(sizeof(int) * 2);
    *returnSize = 2;

    int lo = 0;
    int hi = numbersSize - 1;
    while (lo < hi)
    {
        int sum = numbers[lo] + numbers[hi];
        if (sum > target)
        {
            hi--;
        }
        else if (sum < target)
        {
            lo++;
        }
        else
        {
            // find
            result[0] = lo + 1;
            result[1] = hi + 1;
            return result;
        }

        /* code */
    }
    result[0] = -1;
    result[1] = -1;

    return result;
}

int main()
{

    printf("hello world!\n");

    return 0;
}